//获取本地存储localStorage中的index中的信息
let str_index = localStorage.getItem("index");
let arr_index = JSON.parse( str_index );
console.log( arr_index );

//获取本地存储localStorage中的store中的信息
let str_store = localStorage.getItem( "store" );
let arr_store = JSON.parse( str_store );
console.log( arr_store );

//将.content-box的内容清空
document.querySelectorAll(".content-box")[0].innerHTML = "";
console.log( arr_store.arr1 );

//将满足条件的数组刷新到页面
for( let i = 0;i < arr_store.arr1.length;i++ ){
    arr_index.forEach((item,index) => {
        console.log( item );
        // 判断
        if( arr_store.arr1[i] === item.id ){
            //创建模板字符串
            str = `<div>
            <a href="">
                <img src=${item.pro_imgpath} alt="">
                <div>
                    <p>${item.pro_name}</p>
                    <p>颜色：白色</p>
                    <p>尺码：${item.pro_size}</p>
                </div>
                <span>${item.pro_price}</span>
            </a>
        </div>`;
        document.querySelectorAll(".content-box")[0].innerHTML += str;
        }
    });
}
